//
//  SoundHandler.h
//  
//
//  Created by Fred Havemeyer on 12/30/07.
//  Copyright 2007 __MyCompanyName__. All rights reserved.
//

#include <stdio.h>
#include <time.h>

#include <CoreFoundation/CoreFoundation.h>
#include <Foundation/Foundation.h>

#import <UIKit/UIKit.h>
#import <UIKit/UIView.h>
#import <UIKit/UIApplication.h>
#import <Celestial/AVController.h>
#import <Celestial/AVQueue.h>
#import <Celestial/AVItem.h>
#import <Celestial/AVController-AVController_Celeste.h>

#define TURN_ON		1
#define TURN_OFF	2
#define	IDLE		3
#define SWING		4
#define	STRIKE		5
#define	HIT			6


@interface SoundHandler : AVController {
	NSError *err;
	BOOL somethingPlaying;
	
	AVItem *soundFile;
	
	NSString *currentSound;
	NSString *previousSound;
	NSString *nextSound;
	
	NSString *baseSoundFolderPath;
	
	// Types of sounds playing
	BOOL	idle,
			swinging,
			striking,
			hitting;
	
	BOOL *turningOn;
}
- (id)init;
- (void)dealloc;
- (void)playSoundWithFile:(NSString *)file ofType:(int)type;
- (void)itemFinishedPlaying:(id)fp8;
- (void)playSoundTurningOn:(NSString *)file b:(BOOL *)b;
- (void)setNextSound:(NSString *)file;
- (void)killCurrentSound;
- (void)setBaseFilePath:(NSString *)path;
@end
